<template>
  <div class="order-state-bar">
    <el-steps :space="100" align-center center :active="stateIndex" :process-status="'finish'" finish-status="success">
      <el-step title="待接单"></el-step>
      <el-step title="待测量"></el-step>
      <el-step title="待审核"></el-step>
      <el-step title="待运输"></el-step>
      <el-step title="待安装"></el-step>
      <el-step title="待确认"></el-step>
      <el-step title="已完成"></el-step>
    </el-steps>
    <div class="state-board">
      <span class="state">
        <i class="el-icon-circle-check"></i> 订单状态： {{order | orderStates}}</span>
      <el-button class="cancel-button" type="text">取消订单</el-button>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import filter from '../../../utils/filters'

export default {
  computed: {
    ...mapGetters('orders', ['order']),
    stateIndex: function() {
    		return filter.orderStateIndex(this.order)
    },
  }
}
</script>
